import { defHttp } from '@/utils/http/axios';

const baseUrl = '/user';

enum Api {
  searchUser = `${baseUrl}/searchUser`,
  createUser = `${baseUrl}/createUser`,
  deleteUser = `${baseUrl}/deleteUser`,
  updateUser = `${baseUrl}/updateUser`,
  updatePassword = `${baseUrl}updatePassword`,
  resettingPassword = `${baseUrl}/resettingPassword`,
}

//账号信息相关接口
// 查询所有子账号
export const getSearchUser = (params?: Recordable) => defHttp.post({ url: Api.searchUser, params });
// 创建子账号
export const createUser = (params?: Recordable) => defHttp.post({ url: Api.createUser, params });
// 删除子账号
export const deleteUser = (params?: Recordable) => defHttp.post({ url: Api.deleteUser, params });
// 修改子账号
export const updateUser = (params?: Recordable) => defHttp.post({ url: Api.updateUser, params });
// 修改密码
export const updatePassword = (params?: Recordable) =>
  defHttp.post({ url: Api.updateUser, params });
// 重置密码
export const resettingPassword = (params?: Recordable) =>
  defHttp.post({ url: Api.resettingPassword, params });
